package bit;

public class item15 {
    static int sum =0;
    public static int hammingWeight(int n) {
        while (n!=0)
        {
            n = n&n-1;
            sum++;
        }
       return sum;
    }

    public static void main(String[] args) {
        int x = 01011;
        int i = hammingWeight(00000000000000000000000000001011);
        System.out.println(i);
    }
}
